// ex7_12_4.cpp
#include <iostream>

void set_arr(int *begin1, int *end1, int val);
int main(void)
{
    using namespace std;
    int arr[4];
    int *begin = arr;
    int *end = arr + 4;
    set_arr(begin, end, 1);

    for (int i = 0; i < 4; i++)
    {
        cout << arr[i] << endl;
    }
}

void set_arr(int *begin1, int *end1, int val)
{
    int *ptr;
    for (ptr = begin1; ptr != end1; ptr++)
    {
        *(ptr) = val;
    }
}
